]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Handle calendar-server errors
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 23 Oct 2012 12:32:27 +0000 (14:32 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 24 Oct 2012 16:26:03 +0000 (18:26 +0200)
The current code assumes that the GetEvents call will always
receive, causing an exception in the error case.

https://bugzilla.gnome.org/show_bug.cgi?id=686805

js/ui/calendar.js

index 7ee01cf514e85429901a392bc6a4767b204fbbe9..3a3e73c6698f356fb2657d2172932d982a607ae6 100644 (file)
@@ -270,8 +270,9 @@ const DBusEventSource = new Lang.Class({
         this._loadEvents(false);
     },
 
-    _onEventsReceived: function([appointments]) {
+    _onEventsReceived: function(results, error) {
         let newEvents = [];
+        let appointments = results ? results[0] : null;
         if (appointments != null) {
             for (let n = 0; n < appointments.length; n++) {
                 let a = appointments[n];